package com.aspose.cells;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

class zaew {
   private zaev a;
   private HashMap b;
   private HashMap c;
   private HashMap d;
   private ArrayList e;
   private String f;
   private String g;
   private String h;
   private boolean i;
   private String j;
   private String k;
   private boolean l;
   private boolean m;
   private boolean n;
   private boolean o;
   private boolean p;
   private boolean q;
   private int r = 0;
   private IStreamProvider s;
   private boolean t = false;
   private int u = 0;
   private static final com.aspose.cells.b.c.a.za v = new com.aspose.cells.b.c.a.za(new String[]{"style", "link", "col", "table", "p", "li", "tr", "td", "th", "html", "title", "a", "span", "img", "font", "sup", "sub", "s", "h1", "h2", "h3", "h4", "h5", "h6", "u", "br", "b", "strong", "i", "em", "ol", "ul", "/ol", "/ul", "/style", "/td", "/th", "/span", "/title", "/tr", "/font", "/table", "/p", "/li", "/body", "/a", "/h1", "/h2", "/h3", "/h4", "/h5", "/h6", "mso-page-orientation", "mso-page-numbers-start", "margin", "mso-header-margin", "mso-footer-margin", "mso-horizontal-page-align", "mso-vertical-page-align", "mso-header-data", "mso-footer-data", "color", "background", "background-color", "mso-number-format", "white-space", "font-size", "text-align", "vertical-align", "padding-right", "padding-left", "mso-char-indent-count", "font-family", "font-style", "font-weight", "text-underline-style", "border-top", "border-right", "border-bottom", "border-left", "mso-diagonal-down", "mso-diagonal-up", "border", "border-width", "border-style", "border-color", "mso-pattern", "mso-rotate", "mso-protection", "text-decoration", "mso-text-underline", "ms-text-underline", "layout-flow", "width", "WorksheetType", "WorksheetSource", "Name", "WorksheetOptions", "ConditionalFormatting", "SheetIndex", "Formula", "Print_Area", "print_area", "Print_Titles", "print_titles", "DefaultRowHeight", "CodeName", "Selected", "Panes", "ProtectContents", "ProtectObjects", "ProtectScenarios", "Pane", "Number", "ActiveRow", "ActiveCol", "RangeSelection", "Range", "Condition", "Qualifier", "Value1", "Value2", "Format", "Between", "Equal", "GreaterOrEqual", "GreaterThan", "LessOrEqual", "LessThan", "NotBetween", "NotEqual", "None"});

   public void a(IStreamProvider var1) {
      this.s = var1;
      this.a.a(this.s);
   }

   public zaew(String var1, Workbook var2) {
      this.a = new zaev(var2, this);
      this.a.t(this.c = new HashMap());
      this.f = var1;
      this.b = new HashMap();
      this.d = new HashMap();
      this.i = false;
      this.l = false;
      this.e = new ArrayList();
   }

   public zaew(String var1, Workbook var2, HTMLLoadOptions var3) {
      this.a = new zaev(var2, this);
      this.a.a(var3);
      this.g = var3.getAttachedFilesDirectory();
      this.f = var1;
      this.b = new HashMap();
      this.d = new HashMap();
      this.a.t(this.c = new HashMap());
      this.i = false;
      this.l = false;
      this.e = new ArrayList();
   }

   public zaew(com.aspose.cells.b.a.d.zm var1, Workbook var2, HTMLLoadOptions var3) throws Exception {
      this.a = new zaev(var2, this);
      this.a.a(var3);
      this.g = var3.getAttachedFilesDirectory();
      if (var1 instanceof com.aspose.cells.b.a.d.ze) {
         this.f = ((com.aspose.cells.b.a.d.ze)var1).h_();
      }

      this.b = new HashMap();
      this.d = new HashMap();
      this.a.t(this.c = new HashMap());
      this.i = false;
      this.l = false;
      this.e = new ArrayList();
   }

   public void a(String var1, ArrayList var2) throws Exception {
      if (!"!octype".equals(var1)) {
         HashMap var3 = this.d(var2);
         switch(v.a(var1.toLowerCase())) {
         case 0:
            this.a.j();
            break;
         case 1:
            Object var4 = var3.get("id");
            Object var5 = var3.get("href");
            if (var4 != null && var4.equals("shLink") && var5 != null) {
               com.aspose.cells.b.a.a.ze.a(this.e, var5);
            }
            break;
         case 2:
            this.a.d(var3);
            break;
         case 3:
            Object var6 = var3.get("class");
            if (var6 != null) {
               this.a.g(var3);
            }

            this.n = true;
            if (!this.p) {
               ++this.r;
            }
            break;
         case 4:
            this.o = true;
            this.a.u(var3);
            this.a.n(var3);
            if (!this.n) {
               this.a.b(var3);
            }
            break;
         case 5:
            this.t = true;
            this.a.u(var3);
            this.a.m(var3);
            if (!this.n) {
               this.a.c(var3);
            }
            break;
         case 6:
            if (this.l) {
               this.a.h(var3);
            } else {
               this.a.a(var3);
            }
            break;
         case 7:
            this.p = true;
            if (this.l) {
               this.a.i(var3);
            } else {
               this.a.f(var3);
            }
            break;
         case 8:
            this.a.e(var3);
            break;
         case 9:
            this.c(var2);
            break;
         case 10:
            this.a.h();
            break;
         case 11:
            this.a.a(true);
            this.a.j(var3);
            break;
         case 12:
            this.a.b(true);
            this.a.u(var3);
            String var7 = (String)var3.get("style");
            if (var7 != null) {
               if (!this.n && this.o) {
                  this.a.p(var3);
               } else if (var7.equals("mso-spacerun:yes")) {
                  this.a.q(var3);
               } else if (var7.equals("display:none")) {
                  this.a.l(var3);
               } else {
                  this.l = true;
                  if (var7.indexOf("z-index") > -1) {
                     this.a.a(var3, this.a());
                  } else {
                     this.a.o(var3);
                  }
               }
            }
            break;
         case 13:
            try {
               this.a.k(var3);
            } catch (Exception var9) {
               com.aspose.cells.a.c.zl.b(var9);
            }
            break;
         case 14:
            this.q = true;
            if (!this.n && this.o) {
               this.a.p(var3);
            } else {
               this.d = var3;
               this.a.e(false);
               this.a.f(true);
               this.a.g(true);
               this.a.w();
            }
            break;
         case 15:
            if (this.p && !this.q) {
               this.a.q();
            } else if (!this.d.containsKey("sup")) {
               this.d.put("sup", true);
            }
            break;
         case 16:
            if (this.p && !this.q) {
               this.a.r();
            } else {
               this.d.put("sub", true);
            }
            break;
         case 17:
            if (this.p && !this.q) {
               this.a.v();
            } else {
               this.d.put("s", true);
            }
            break;
         case 18:
            this.a("h1", var3);
            break;
         case 19:
            this.a("h2", var3);
            break;
         case 20:
            this.a("h3", var3);
            break;
         case 21:
            this.a("h4", var3);
            break;
         case 22:
            this.a("h5", var3);
            break;
         case 23:
            this.a("h6", var3);
            break;
         case 24:
            this.a.s();
            break;
         case 25:
            this.a.l();
            break;
         case 26:
         case 27:
            this.a.t();
            break;
         case 28:
         case 29:
            this.a.u();
            break;
         case 30:
         case 31:
            ++this.u;
            if (this.t) {
               this.l();
            }
         }

      }
   }

   private void a(String var1, HashMap var2) throws Exception {
      this.a.a(var2);
      String var3 = null;
      switch(v.a(var1.toLowerCase())) {
      case 18:
         var3 = "font-size:24pt;font-weight:bold";
         break;
      case 19:
         var3 = "font-size:18pt;font-weight:bold";
         break;
      case 20:
         var3 = "font-size:13.5pt;font-weight:bold";
         break;
      case 21:
         var3 = "font-size:12pt;font-weight:bold";
         break;
      case 22:
         var3 = "font-size:10pt;font-weight:bold";
         break;
      case 23:
         var3 = "font-size:7.5pt;font-weight:bold";
      }

      if (var2.get("style") != null) {
         String var4 = ((String)var2.get("style")).trim().toLowerCase();
         if (var4.indexOf("text-align") != -1) {
            String[] var5 = com.aspose.cells.b.a.zv.d(var4, new char[]{';'});

            for(int var6 = 0; var6 < var5.length; ++var6) {
               if (var5[var6].indexOf("text-align") != -1) {
                  String[] var7 = com.aspose.cells.b.a.zv.d(var5[var6], new char[]{':'});
                  if (var7[1].trim().equals("center") || var7[1].trim().equals("right")) {
                     this.a.J();
                  }
               }
            }
         }

         if (var4.endsWith(";")) {
            var2.put("style", var4 + var3);
         } else {
            var2.put("style", var4 + ";" + var3);
         }
      } else {
         var2.put("style", var3);
      }

      this.a.f(var2);
   }

   public void b(String var1, ArrayList var2) {
      switch(v.a(var1.toLowerCase())) {
      case 32:
      case 33:
         --this.u;
         break;
      case 34:
         this.a.k();
         break;
      case 35:
      case 36:
         this.p = false;
         if (!this.l) {
            this.j();
         } else {
            this.a.f();
         }
         break;
      case 37:
         this.a.b(false);
         this.l = false;
         this.a.g();
         break;
      case 38:
         this.a.i();
         break;
      case 39:
         if (this.l) {
            this.a.e();
         }
         break;
      case 40:
         this.q = false;
         this.a.r(this.d);
         this.a.c(false);
         this.a.d(false);
         break;
      case 41:
         this.n = false;
         if (!this.q && !this.o && !this.p && !this.t) {
            this.a.y();
         }
         break;
      case 42:
         this.k();
         this.o = false;
         break;
      case 43:
         this.t = false;
         this.l();
         break;
      case 44:
         if (this.r == 1) {
            this.a.y();
         }
         break;
      case 45:
         this.a.n();
         this.a.a(false);
         break;
      case 46:
      case 47:
      case 48:
      case 49:
      case 50:
      case 51:
         this.a.o();
         this.a.a((HashMap)null);
      }

   }

   private void j() {
      if (this.a.B() > 0) {
         Cell var1 = this.a.d();
         if (var1 != null && var1.getFormula() != null && !"".equals(var1.getFormula().trim()) && var1.getType() != 3) {
            this.a.h(false);
            this.a.x();
            this.a.b(0);
            this.a.g(false);
            this.m = false;
            this.a.m();
            return;
         }

         this.a.p();
         if (this.a.d() != null) {
            this.a.C();
         }

         this.a.A();
      } else {
         this.a.o();
      }

      this.a.h(false);
      this.a.x();
      this.a.b(0);
      this.a.g(false);
      this.m = false;
   }

   private void k() {
      if (this.a.B() > 0) {
         this.a.p();
         if (this.a.d() != null && this.a.d().getValue() != null) {
            this.a.C();
         }

         this.a.A();
      } else {
         this.a.o();
      }

   }

   private void l() {
      this.k();
   }

   public void a(String var1) throws Exception {
      this.a.c(var1);
   }

   public void b(String var1) throws Exception {
      if (var1.startsWith("table")) {
         if (-1 != var1.indexOf("@page")) {
            this.e(var1);
         }

         if (!this.i) {
            this.c(var1);
         }
      } else if (var1.startsWith("[if gte vml 1]")) {
         this.h(var1);
      } else if (var1.startsWith("[if !mso & vml]")) {
         this.g(var1);
      } else if (var1.indexOf("xml") != -1) {
         this.f(var1);
      }

   }

   private void e(String var1) throws Exception {
      if (!"/*".equals(var1) && !"*/".equals(var1) && !var1.startsWith("@import")) {
         new ArrayList();
         zaet var3 = new zaet();
         byte[] var4 = Encoding.getEncoding("gb2312").a(var1);
         com.aspose.cells.b.a.d.zh var5 = new com.aspose.cells.b.a.d.zh(var4);
         var3.a(var5);
         ArrayList var2 = var3.n();
         if (var2.size() > 0) {
            this.a(var2);
         }

      }
   }

   private void a(ArrayList var1) {
      if (this.e().E() == null) {
         this.e().a(this.e().F().get(0));
      }

      Worksheet var2 = this.e().E();
      Iterator var3 = var1.iterator();

      while(var3.hasNext()) {
         zaes var4 = (zaes)var3.next();
         if ("@page".equals(var4.l())) {
            this.a(var2, var4.d());
            break;
         }
      }

   }

   private void a(Worksheet var1, ArrayList var2) {
      Iterator var3 = var2.iterator();

      while(true) {
         label53:
         while(var3.hasNext()) {
            zaeo var4 = (zaeo)var3.next();
            switch(v.a(var4.a().toLowerCase())) {
            case 52:
               if ("landscape".equals(var4.b().toLowerCase())) {
                  var1.getPageSetup().setOrientation(0);
               } else {
                  var1.getPageSetup().setOrientation(1);
               }
               break;
            case 53:
               var1.getPageSetup().setFirstPageNumber(com.aspose.cells.b.a.ze.d(var4.b()));
               break;
            case 54:
               this.a(var1, var4.b());
               break;
            case 55:
               if (var4.b().indexOf("in") != -1) {
                  var1.getPageSetup().setHeaderMarginInch(com.aspose.cells.b.a.ze.g(var4.b().substring(0, 0 + (var4.b().length() - 2))));
               } else {
                  var1.getPageSetup().setHeaderMargin(com.aspose.cells.b.a.ze.g(var4.b()));
               }
               break;
            case 56:
               if (var4.b().indexOf("in") != -1) {
                  var1.getPageSetup().setFooterMarginInch(com.aspose.cells.b.a.ze.g(var4.b().substring(0, 0 + (var4.b().length() - 2))));
               } else {
                  var1.getPageSetup().setFooterMargin(com.aspose.cells.b.a.ze.g(var4.b()));
               }
               break;
            case 57:
               var1.getPageSetup().setCenterHorizontally(true);
               break;
            case 58:
               var1.getPageSetup().setCenterVertically(true);
               break;
            case 59:
               var4.a(com.aspose.cells.b.a.zv.a(var4.b(), "\"", ""));
               String[] var5 = zasp.a(var4.b());
               int var8 = 0;

               while(true) {
                  if (var8 >= 3) {
                     continue label53;
                  }

                  if (null != var5[var8]) {
                     var1.getPageSetup().setHeader(var8, var5[var8]);
                  }

                  ++var8;
               }
            case 60:
               var4.a(com.aspose.cells.b.a.zv.a(var4.b(), "\"", ""));
               String[] var6 = zasp.a(var4.b());

               for(int var7 = 0; var7 < 3; ++var7) {
                  if (null != var6[var7]) {
                     var1.getPageSetup().setFooter(var7, var6[var7]);
                  }
               }
            }
         }

         return;
      }
   }

   private void a(Worksheet var1, String var2) {
      String[] var3 = com.aspose.cells.b.a.zv.d(var2, new char[]{' '});
      if (4 != var3.length) {
         com.aspose.cells.a.c.zl.b(new Exception("pagesetup margins error"));
      } else {
         if (-1 != var3[0].indexOf("in")) {
            var1.getPageSetup().setTopMarginInch(com.aspose.cells.b.a.ze.g(var3[0].substring(0, 0 + (var3[0].length() - 2))));
         } else {
            var1.getPageSetup().setTopMargin(com.aspose.cells.b.a.ze.g(var3[0]));
         }

         if (-1 != var3[1].indexOf("in")) {
            var1.getPageSetup().setRightMarginInch(com.aspose.cells.b.a.ze.g(var3[1].substring(0, 0 + (var3[1].length() - 2))));
         } else {
            var1.getPageSetup().setRightMargin(com.aspose.cells.b.a.ze.g(var3[1]));
         }

         if (-1 != var3[2].indexOf("in")) {
            var1.getPageSetup().setBottomMarginInch(com.aspose.cells.b.a.ze.g(var3[2].substring(0, 0 + (var3[2].length() - 2))));
         } else {
            var1.getPageSetup().setBottomMargin(com.aspose.cells.b.a.ze.g(var3[2]));
         }

         if (-1 != var3[3].indexOf("in")) {
            var1.getPageSetup().setLeftMarginInch(com.aspose.cells.b.a.ze.g(var3[3].substring(0, 0 + (var3[3].length() - 2))));
         } else {
            var1.getPageSetup().setLeftMargin(com.aspose.cells.b.a.ze.g(var3[3]));
         }

      }
   }

   public void a(com.aspose.cells.b.a.d.zm var1) throws Exception {
      new ArrayList();
      zaet var3 = new zaet();
      var3.a(var1);
      ArrayList var2 = var3.n();
      if (var2.size() > 0) {
         this.b(var2);
      }

   }

   public void c(String var1) throws Exception {
      if (!"/*".equals(var1) && !"*/".equals(var1) && !var1.startsWith("@import")) {
         new ArrayList();
         zaet var3 = new zaet();
         byte[] var4 = Encoding.getEncoding("gb2312").a(var1);
         com.aspose.cells.b.a.d.zh var5 = new com.aspose.cells.b.a.d.zh(var4);
         var3.a(var5);
         ArrayList var2 = var3.n();
         if (var2.size() > 0) {
            this.b(var2);
         }

      }
   }

   private void b(ArrayList var1) throws Exception {
      Iterator var2 = var1.iterator();

      while(var2.hasNext()) {
         zaes var3 = (zaes)var2.next();
         if (this.e().H() != null && !this.e().H().containsKey(var3.l()) && !var3.l().equals("@page")) {
            boolean var4 = false;
            Style var5;
            int var6;
            if (var3.l().equals("style0")) {
               var5 = this.e().G().getDefaultStyle();
               var6 = 0;
            } else {
               var5 = this.e().G().createStyle();
               var6 = -1;
            }

            this.a(var3.d(), var5);
            if (var6 < 0) {
               var6 = this.e().G().getWorksheets().B().c(var5);
            } else {
               this.e().G().setDefaultStyle(var5);
            }

            this.e().H().put(var3.l(), var6);
         }
      }

   }

   private void a(ArrayList var1, Style var2) throws Exception {
      Font var3 = var2.getFont();
      String var4 = null;
      String var5 = null;
      String var6 = null;
      String var7 = null;
      String var8 = null;
      Iterator var9 = var1.iterator();

      while(true) {
         while(var9.hasNext()) {
            zaeo var10 = (zaeo)var9.next();
            int var13;
            switch(v.a(var10.a().toLowerCase())) {
            case 61:
               var3.setColor(zaer.g(var10.b()));
               break;
            case 62:
            case 63:
               if (!"auto".equals(var10.b())) {
                  var4 = var10.b();
               }
               break;
            case 64:
               zaer.a(var2, var10.b());
               break;
            case 65:
               String var11 = var10.b().toLowerCase();
               var2.setTextWrapped(var11.indexOf("normal") != -1 && var11.indexOf("nowrap") == -1);
               break;
            case 66:
               String var12 = var10.b().trim().toLowerCase();
               if (!var12.endsWith("pt") && !var12.endsWith("px") && !var12.endsWith("in")) {
                  if (var12.endsWith("%")) {
                     var12 = var12.substring(0, 0 + (var12.length() - 1));
                     var3.setDoubleSize(var3.getDoubleSize() * (com.aspose.cells.b.a.zn.a(var12) / 100.0D));
                  } else if (var12.endsWith("em")) {
                     var12 = var12.substring(0, 0 + (var12.length() - 2));
                     var3.setDoubleSize(var3.getDoubleSize() * com.aspose.cells.b.a.zn.a(var12));
                  } else if (zaeu.d(var12)) {
                     var3.setDoubleSize(var3.getDoubleSize() * zaeu.e(var12));
                  } else {
                     var3.setDoubleSize(zaeu.b(var12));
                  }
                  break;
               }

               double var22 = zaeu.b(var12);
               if (var22 > 0.0D && var22 < 1.0D) {
                  var22 = 1.0D;
               }

               var3.setDoubleSize(var22);
               break;
            case 67:
               var13 = zaer.d(var10.b());
               var2.setHorizontalAlignment(var13);
               if (var2.getHorizontalAlignment() != 7 && var2.getHorizontalAlignment() != 8) {
                  var2.setIndentLevel(0);
               }
               break;
            case 68:
               var13 = zaer.e(var10.b());
               var2.setVerticalAlignment(var13);
               break;
            case 69:
               String var14 = var10.b().toLowerCase();
               int var15 = (new zaed(this.a.G())).a(var2, "0");
               int var16 = 0;
               if (!var14.endsWith("pt") && !var14.endsWith("px") && !var14.endsWith("in")) {
                  if (var14.endsWith("em")) {
                     var14 = var14.substring(0, 0 + (var14.length() - 2));
                     var16 = (int)((double)var15 * com.aspose.cells.b.a.zn.a(var14));
                  }
               } else {
                  var16 = zaeu.a(var14);
               }

               var2.setIndentLevel(var16 / var15 + (var16 % var15 == 0 ? 0 : 1));
               var2.setHorizontalAlignment(8);
               break;
            case 70:
               String var17 = var10.b().toLowerCase();
               int var18 = (new zaed(this.a.G())).a(var2, "0");
               int var19 = 0;
               if (!var17.endsWith("pt") && !var17.endsWith("px") && !var17.endsWith("in")) {
                  if (var17.endsWith("em")) {
                     var17 = var17.substring(0, 0 + (var17.length() - 2));
                     var19 = (int)((double)var18 * com.aspose.cells.b.a.zn.a(var17));
                  }
               } else {
                  var19 = zaeu.a(var17);
               }

               var2.setIndentLevel(var19 / var18 + (var19 % var18 == 0 ? 0 : 1));
               var2.setHorizontalAlignment(7);
               break;
            case 71:
               var2.setIndentLevel(zase.C(var10.b()));
               break;
            case 72:
               zaeu.a(var10.b(), var3);
               break;
            case 73:
               var3.setItalic(var10.b().equals("italic"));
               break;
            case 74:
               if ("bold".equals(var10.b())) {
                  var3.setBold(true);
               } else if ("plain".equals(var10.b())) {
                  var3.setBold(false);
               } else if ("normal".equals(var10.b())) {
                  var3.setBold(false);
               } else {
                  var3.setBold(com.aspose.cells.b.a.ze.f(var10.b()) >= 700);
               }
               break;
            case 75:
               zaer.a(var3, var10.b());
               break;
            case 76:
            case 77:
            case 78:
            case 79:
            case 80:
            case 81:
            case 82:
               zaeq.a(var10.a(), var10.b(), var2);
               break;
            case 83:
               var6 = var10.b();
               break;
            case 84:
               var7 = var10.b();
               break;
            case 85:
               String var20 = var10.b();
               if (var20.indexOf(" ") != -1) {
                  var8 = var10.b().substring(0, 0 + var20.indexOf(" "));
               } else {
                  var8 = var10.b();
               }
               break;
            case 86:
               var5 = var10.b();
               break;
            case 87:
               var2.setRotationAngle(com.aspose.cells.b.a.ze.f(var10.b()));
               break;
            case 88:
               if (var10.b().indexOf("unlocked") != -1) {
                  var2.setLocked(false);
               }

               if (var10.b().indexOf("hidden") != -1) {
                  var2.setFormulaHidden(true);
               }
               break;
            case 89:
               if ("underline".equals(var10.b())) {
                  var3.setUnderline(zaer.f(var10.b()));
               }

               if ("line-through".equals(var10.b())) {
                  var3.setStrikeout(true);
               }
               break;
            case 90:
               var3.setUnderline(zaer.f(var10.b()));
               break;
            case 91:
               var3.setUnderline(zaer.f(var10.b()));
               break;
            case 92:
               if (var10.b().toLowerCase().equals("vertical")) {
                  var2.setRotationAngle(255);
               }
            }
         }

         if (var4 != null && (var5 == null || "auto none".equals(var5))) {
            var2.setForegroundColor(zaer.g(var4));
            var2.setBackgroundColor(var2.getForegroundColor());
            var2.setPattern(1);
         }

         if (var4 == null && var5 != null) {
            zaer.a(var5, var2);
         }

         if (var4 != null && var5 != null) {
            Color var21 = zaer.g(var4);
            zaer.a(var5, var2, var21);
         }

         if (var6 != null && var8 != null && var7 != null) {
            zaeq.a(var6, var7, var8, var2);
         }

         return;
      }
   }

   private void f(String var1) throws Exception {
      int var2 = var1.indexOf("<xml>");
      String var3 = "<![endif]";
      if (var1.endsWith(var3)) {
         String var4 = var1.substring(var2, var2 + (var1.length() - var3.length() - var2));
         String var5 = this.k(var4);
         zcfk var6 = zass.a((String)this.i(var5), (zcft)null, false);
         zcfs var7 = var6.e("o:DocumentProperties");
         if (var7.a() > 0) {
            BuiltInDocumentPropertyCollection var8 = this.e().F().getBuiltInDocumentProperties();
            zaeu.a(var7, var8);
         }

         zcfs var10 = var6.e("o:CustomDocumentProperties");
         if (var10.a() > 0) {
            CustomDocumentPropertyCollection var9 = this.e().F().getCustomDocumentProperties();
            zaeu.a(var10, var9);
         }

         this.a(var6);
         this.d(var6);
         this.e(var6);
         if (this.e().E() != null) {
            this.b(var6);
            this.c(var6);
         }
      }

   }

   private void g(String var1) throws Exception {
      int var2 = "[if !mso & vml]>".length();
      String var3 = "<![endif]";
      if (var1.endsWith(var3)) {
         String var4 = var1.substring(var2, var2 + (var1.length() - var3.length() - var2));
         String var5 = this.l(var4);
         zcfk var6 = zass.a((String)this.j(var5), (zcft)null, false);
         zcfs var7 = var6.e("ele");

         for(int var8 = 0; var8 < var7.a(); ++var8) {
            zcfl var9 = (zcfl)var7.a(var8);
            zcfs var10 = var9.j();

            for(int var11 = 0; var11 < var10.a(); ++var11) {
               zcfq var12 = var10.a(var11);
               if (!(var12 instanceof zcfv)) {
                  zcfl var13 = (zcfl)var12;
                  String var14 = var13.g;
                  switch(v.a(var14.toLowerCase())) {
                  case 12:
                     String var15 = var13.b("style");
                     String[] var16 = com.aspose.cells.b.a.zv.d(var15, ';');
                     String[] var17 = var16;
                     int var18 = var16.length;
                     int var19 = 0;

                     while(var19 < var18) {
                        String var20 = var17[var19];
                        String[] var21 = com.aspose.cells.b.a.zv.d(var20, ':');
                        String var22 = zaeu.f(var21[0]);
                        switch(v.a(var22.toLowerCase())) {
                        case 93:
                           this.a.a(zaeu.a(var21[1]));
                        default:
                           ++var19;
                        }
                     }
                  }
               }
            }
         }
      }

   }

   private void h(String var1) throws Exception {
      int var2 = "[if gte vml 1]>".length();
      String var3 = "<![endif]";
      if (var1.endsWith(var3)) {
         String var4 = var1.substring(var2, var2 + (var1.length() - var3.length() - var2));
         String var5 = this.l(var4);
         zcfk var6 = zass.a((String)this.j(var5), (zcft)null, false);
         zcfs var7 = var6.e("ele");
         if (var7.a() > 0) {
            String var8 = this.a();
            zaeu.a(var7, this.c, var8, this.s);
         }

         zcfs var10 = var6.e("o:CustomDocumentProperties");
         if (var10.a() > 0) {
            CustomDocumentPropertyCollection var9 = this.e().F().getCustomDocumentProperties();
            zaeu.a(var10, var9);
         }
      }

   }

   private String i(String var1) {
      return com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(var1, "&", "&amp;"), "<=", "&lt;"), "<br>", "\n"), "<![if excel]>", "<SkipEle>"), "<![if gte mso 9]>", "<SkipEle>"), "<![endif]>", "</SkipEle>");
   }

   private String j(String var1) {
      return com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(var1, "<=", "&lt;"), "<br>", "\n"), "<![if excel]>", "<SkipEle>"), "<![if gte mso 9]>", "<SkipEle>"), "<![endif]>", "</SkipEle>");
   }

   public String a() {
      String var1 = null;
      if (this.k == null) {
         if (this.g == null) {
            if (this.f == null) {
               return null;
            }

            if (this.f.lastIndexOf("\\") == -1) {
               var1 = this.f.substring(0, 0 + this.f.lastIndexOf("/")) + "/";
            } else {
               var1 = this.f.substring(0, 0 + this.f.lastIndexOf("\\")) + "\\";
            }
         } else {
            var1 = this.g;
         }
      } else {
         var1 = this.k;
      }

      return var1;
   }

   public String b() {
      return this.f;
   }

   private void c(ArrayList var1) {
      StringBuilder var2 = new StringBuilder();
      var2.append("<html ");
      Iterator var3 = var1.iterator();

      while(var3.hasNext()) {
         zaeo var4 = (zaeo)var3.next();
         var2.append(var4.a());
         var2.append("=\"");
         var2.append(var4.b());
         var2.append("\" ");
      }

      var2.append(">");
      this.h = com.aspose.cells.b.a.zr.a(var2);
   }

   private HashMap d(ArrayList var1) {
      HashMap var2 = new HashMap();
      Iterator var3 = var1.iterator();

      while(var3.hasNext()) {
         zaeo var4 = (zaeo)var3.next();
         if (!"".equals(var4.a())) {
            if (var2.get(var4.a()) == null) {
               var2.put(var4.a(), var4.b());
            } else if (var4.a().toLowerCase().equals("colspan") && zase.C(var4.b()) > zase.C((String)var2.get(var4.a()))) {
               var2.put(var4.a(), var4.b());
            }
         }
      }

      return var2;
   }

   private String k(String var1) {
      StringBuilder var2 = new StringBuilder();
      return com.aspose.cells.b.a.zr.a(var2.append(this.h).append(var1).append("</html>"));
   }

   private String l(String var1) {
      StringBuilder var2 = new StringBuilder();
      return com.aspose.cells.b.a.zr.a(var2.append(this.h).append("<ele>").append(var1).append("</ele></html>"));
   }

   private void a(zcfk var1) {
      zaeu.a(var1, this.e().G());
   }

   private void b(zcfk var1) throws Exception {
      zaeu.a(var1, this.e());
   }

   private void c(zcfk var1) {
      zaeu.b(var1, this.e());
   }

   private void d(zcfk var1) throws Exception {
      zcfs var2 = var1.e("x:Stylesheet");
      if (var2.a() == 1) {
         this.i = true;
         String var3 = "";
         zcfl var4 = (zcfl)var2.a(0);
         String var5 = var4.b("HRef");
         if (var5.startsWith("file:///")) {
            var3 = zaer.c(var5);
         } else {
            if (null != this.f) {
               var3 = com.aspose.cells.b.a.d.zk.e(this.f) + "/" + zaer.c(var5);
            }

            if (null != this.g) {
               var3 = this.g + "/" + zaer.c(var5);
            }
         }

         new ArrayList();
         zaet var7 = new zaet();
         StreamProviderOptions var8 = new StreamProviderOptions();
         var8.a = var5;
         var8.b = var3;
         this.s.initStream(var8);
         var7.a(var8.c);
         if (var7.k() != null) {
            ArrayList var6 = var7.n();
            this.b(var6);
         }
      }

   }

   private void e(zcfk var1) throws Exception {
      byte var2 = 1;
      zcfs var3 = var1.e("x:ExcelWorksheet");
      if (var3.a() > 0 && this.i) {
         this.e().F().clear();
      }

      for(int var4 = 0; var4 < var3.a(); ++var4) {
         String var5 = "";
         com.aspose.cells.b.a.d.zm var6 = null;
         String var7 = null;
         Worksheet var8 = null;
         if (var4 >= this.e().F().getCount()) {
            int var9 = this.e().F().add();
            var8 = this.e().F().get(var9);
         } else {
            var8 = this.e().F().get(var4);
         }

         zcfl var19 = (zcfl)var3.a(var4);
         zcfs var10 = var19.j();

         for(int var11 = 0; var11 < var10.a(); ++var11) {
            zcfq var12 = var10.a(var11);
            if (!(var12 instanceof zcfv)) {
               zcfl var13 = (zcfl)var12;
               String var14 = var13.a();
               String var15 = var13.g;
               switch(v.a(var15)) {
               case 94:
                  if (var14.equals("Chart")) {
                     var2 = 2;
                  }
                  break;
               case 95:
                  var7 = var13.b("HRef");
                  if (var7.startsWith("file:///")) {
                     var5 = zaer.c(var7);
                  } else {
                     String var16 = var7.substring(0, 0 + (var7.lastIndexOf("/") == -1 ? var7.lastIndexOf("\\") : var7.lastIndexOf("/")));
                     if (null != this.f) {
                        var5 = com.aspose.cells.b.a.d.zk.e(this.f) + "/" + zaer.c(var7);
                        this.k = com.aspose.cells.b.a.d.zk.e(this.f) + "/" + var16 + "/";
                     }

                     if (null != this.g) {
                        var5 = this.g + "/" + zaer.c(var7);
                        this.k = this.g + var16 + "/";
                     }
                  }

                  StreamProviderOptions var21 = new StreamProviderOptions();
                  var21.a = var7;
                  if (var7.startsWith("./")) {
                     var21.a = var21.a.substring(1);
                  }

                  var21.b = var5;
                  this.s.initStream(var21);
                  var6 = var21.c;
                  break;
               case 96:
                  var8.setName(zaff.b(var14));
                  break;
               case 97:
                  zcfs var17 = var13.j();
                  this.a(var17, var8);
                  break;
               case 98:
                  zcfs var18 = var13.j();
                  this.d(var18, var8);
               }
            }
         }

         var8.setType(var2);
         var2 = 1;
         if (var6 != null) {
            String var20 = "".equals(var5) ? var7 : var5;
            this.b.put(var8.getName() + '\b' + var20, var6);
         }
      }

      this.a(var1, this.e());
      if (var3.a() == 1 || this.b.size() == 0) {
         this.e().a(this.e().F().get(0));
         this.e().a(this.e().E().getCells());
      }

   }

   private void a(zcfk var1, zaev var2) {
      zcfs var3 = var1.e("x:ExcelName");
      if (null != var3 && var3.a() > 0) {
         String var4 = "";
         String var5 = "";
         int var6 = -1;
         String var7 = "";
         Object var8 = null;
         zcfl var9 = null;
         zcfs var10 = null;
         zcfl var11 = null;
         new com.aspose.cells.b.a.g.a.ze("\\S?!\\$\\d{1,}:\\$\\d{1,}");

         for(int var13 = 0; var13 < var3.a(); ++var13) {
            var9 = (zcfl)var3.a(var13);
            var10 = var9.j();

            for(int var14 = 0; var14 < var10.a(); ++var14) {
               if (!(var10.a(var14) instanceof zcfv)) {
                  var11 = (zcfl)var10.a(var14);
                  switch(v.a(var11.g)) {
                  case 96:
                     var4 = var11.a().toLowerCase();
                  case 97:
                  case 98:
                  default:
                     break;
                  case 99:
                     var6 = com.aspose.cells.b.a.ze.f(var11.a());
                     break;
                  case 100:
                     if (!"print_area".equals(var4) && !"print_titles".equals(var4)) {
                        var7 = var11.a();
                        var5 = "";
                     } else {
                        var7 = var11.a();

                        try {
                           var5 = var7.substring(1, 1 + (var7.indexOf("!") - 1));
                        } catch (Exception var16) {
                           ;
                        }
                     }
                  }
               }
            }

            if (!"".equals(var7)) {
               if (var6 == -1 && "".equals(var5)) {
                  zafd.a.put(var4, var7);
               }

               Iterator var17 = var2.F().iterator();

               while(var17.hasNext()) {
                  Worksheet var15 = (Worksheet)var17.next();
                  if (var15.getName().equals(var5)) {
                     switch(v.a(var4)) {
                     case 101:
                     case 102:
                        var15.getPageSetup().setPrintArea(var7);
                        break;
                     case 103:
                     case 104:
                        var15.getPageSetup().a(var7);
                     }
                  }
               }

               var6 = -1;
               var7 = "";
            }
         }

      }
   }

   private void a(zcfs var1, Worksheet var2) {
      for(int var3 = 0; var3 < var1.a(); ++var3) {
         zcfq var4 = var1.a(var3);
         if (!(var4 instanceof zcfv)) {
            zcfl var5 = (zcfl)var4;
            String var6 = var5.g;
            switch(v.a(var6)) {
            case 105:
            case 106:
            case 107:
            case 109:
            case 110:
            case 111:
            default:
               break;
            case 108:
               zcfs var7 = var5.j();
               this.b(var7, var2);
            }
         }
      }

   }

   private void b(zcfs var1, Worksheet var2) {
      for(int var3 = 0; var3 < var1.a(); ++var3) {
         zcfq var4 = var1.a(var3);
         if (!(var4 instanceof zcfv)) {
            zcfl var5 = (zcfl)var4;
            String var6 = var5.g;
            switch(v.a(var6)) {
            case 112:
               zcfs var7 = var5.j();
               this.c(var7, var2);
            }
         }
      }

   }

   private void c(zcfs var1, Worksheet var2) {
      Object var3 = null;
      String var4 = null;
      String var5 = null;
      Object var6 = null;

      for(int var7 = 0; var7 < var1.a(); ++var7) {
         zcfq var8 = var1.a(var7);
         if (!(var8 instanceof zcfv)) {
            zcfl var9 = (zcfl)var8;
            String var10 = var9.a();
            String var11 = var9.g;
            switch(v.a(var11)) {
            case 113:
               break;
            case 114:
               var4 = var10;
               break;
            case 115:
               var5 = var10;
            case 116:
            }
         }
      }

      if (var4 != null && !"".equals(var4) && var5 != null && !"".equals(var5)) {
         var2.setActiveCell(CellsHelper.cellIndexToName(com.aspose.cells.b.a.zo.a(var4), com.aspose.cells.b.a.zo.a(var5)));
      }

   }

   private void d(zcfs var1, Worksheet var2) {
      String var3 = null;
      int var4 = 6;
      String var5 = null;
      String var6 = null;
      String var7 = null;

      int var8;
      for(var8 = 0; var8 < var1.a(); ++var8) {
         zcfq var9 = var1.a(var8);
         if (!(var9 instanceof zcfv)) {
            zcfl var10 = (zcfl)var9;
            String var11 = var10.a();
            String var12 = var10.g;
            switch(v.a(var12)) {
            case 117:
               var3 = var11;
               break;
            case 118:
               zcfs var13 = var10.j();
               int[] var14 = new int[]{var4};
               String[] var15 = new String[]{var5};
               String[] var16 = new String[]{var6};
               String[] var17 = new String[]{var7};
               this.a(var13, var14, var15, var16, var17);
               var4 = var14[0];
               var5 = var15[0];
               var6 = var16[0];
               var7 = var17[0];
            }
         }
      }

      var8 = var2.getConditionalFormattings().add();
      FormatConditionCollection var18 = var2.getConditionalFormattings().get(var8);
      this.a(var3, var18);
      FormatCondition var19 = new FormatCondition(var18);
      var19.setOperator(var4);
      var19.setType(2);
      var18.a(var19);
   }

   private void a(String var1, FormatConditionCollection var2) {
      var1 = com.aspose.cells.b.a.zv.a(var1, "$", "");
      String[] var3 = com.aspose.cells.b.a.zv.d(var1, ' ');

      for(int var4 = 0; var4 < var3.length; ++var4) {
         String[] var5 = com.aspose.cells.b.a.zv.d(var3[var4], ':');
         String var6 = var5[0];
         String var7 = var5[var5.length - 1];
         CellArea var8 = CellArea.createCellArea(var6, var7);
         com.aspose.cells.b.a.a.ze.a(var2.b, (Object)var8);
      }

   }

   private void a(zcfs var1, int[] var2, String[] var3, String[] var4, String[] var5) {
      var2[0] = 6;
      var3[0] = null;
      var4[0] = null;
      var5[0] = null;

      for(int var6 = 0; var6 < var1.a(); ++var6) {
         zcfq var7 = var1.a(var6);
         if (!(var7 instanceof zcfv)) {
            zcfl var8 = (zcfl)var7;
            String var9 = var8.a();
            String var10 = var8.g;
            switch(v.a(var10)) {
            case 119:
               var2[0] = this.m(var9);
               break;
            case 120:
               var3[0] = var9;
               break;
            case 121:
               var4[0] = var9;
               break;
            case 122:
               var5[0] = var8.b("Style");
            }
         }
      }

   }

   private int m(String var1) {
      switch(v.a(var1)) {
      case 123:
         return 0;
      case 124:
         return 1;
      case 125:
         return 3;
      case 126:
         return 2;
      case 127:
         return 5;
      case 128:
         return 4;
      case 129:
         return 7;
      case 130:
         return 8;
      case 131:
      default:
         return 6;
      }
   }

   public void c() {
      this.a.D();
   }

   public HashMap d() {
      return this.b;
   }

   public zaev e() {
      return this.a;
   }

   public void d(String var1) {
      this.j = var1;
   }

   public void f() {
      this.c.clear();
   }

   public ArrayList g() {
      return this.e;
   }

   boolean h() {
      return this.n;
   }

   int i() {
      return this.u;
   }
}
